<form class="form-inline" action="<?=printUrl('Main','adminSubScore')?>" name="subScore" id="subScore">
<div class="table-responsive">
<table border="1" cellspacing="0" style="width: 2000px;" class="table table-hover table-bordered table-condensed">
  <thead>
    <tr>
      <th class="bg-primary text-center" rowspan="2">地区</th>
      <th class="bg-primary text-center" rowspan="2">大区</th>
      <th class="bg-primary text-center" rowspan="2">小区</th>
      <th class="bg-primary text-center" rowspan="2">城市</th>
      <th class="bg-primary text-center" rowspan="2">编码</th>
      <th class="bg-primary text-center" rowspan="2">专营店</th>
      <th class="bg-primary text-center" colspan="4">双月预算明细</th>
      <th class="bg-primary text-center" colspan="12">双月结算明细</th>
    </tr>
    <tr>
      <th class="bg-primary text-center">广宣预算申请金额</th>
      <th class="bg-primary text-center">场租预算申请金额</th>
      <th class="bg-primary text-center">配套预算申请金额</th>
      <th class="bg-primary text-center">预算申请总金额</th>

      <th class="bg-primary text-center">广宣活动补贴</th>
      <th class="bg-primary text-center">广宣结算申请金额</th>
      <th class="bg-primary text-center">广宣可结算金额</th>
      <th class="bg-primary text-center">参展专营店实际出资总额</th>
      <th class="bg-primary text-center">启辰店实际出资总额</th>
      <th class="bg-primary text-center">RMP支持场租费用</th>
      <th class="bg-primary text-center">配套额度</th>
      <th class="bg-primary text-center">配套结算申请金额</th>
      <th class="bg-primary text-center">配套可结算金额</th>
      <th class="bg-primary text-center">本站结算金额</th>
      <th class="bg-primary text-center">KPI系数</th>
      <th class="bg-primary text-center">最终结算金额</th>
    </tr>
  </thead>
  <tbody>
    <?php
    foreach ($procList as $k => $v) {
      /*if($v['budgetApply'] == 0){
        unset($procList[$k]);
        continue;
      }*/
    ?>
    <tr>
      <td class="text-center"><?=isset($allStoreList[$v['storeId']]) ? $allStoreList[$v['storeId']]['area'] : ''?></td>
      <td class="text-center"><?=isset($allStoreList[$v['storeId']]) ? $allStoreList[$v['storeId']]['region'] : ''?></td>
      <td class="text-center"><?=isset($allStoreList[$v['storeId']]) ? $allStoreList[$v['storeId']]['spsarea'] : ''?></td>
      <td class="text-center"><?=isset($allStoreList[$v['storeId']]) ? $allStoreList[$v['storeId']]['city'] : ''?></td>
      <td class="text-center"><a href="<?=printUrl('CarBudget','adminList', array('storeId'=>$v['storeId']))?>" target="_blank"><?=isset($allStoreList[$v['storeId']]) ? $allStoreList[$v['storeId']]['coding'] : ''?></a></td>
      <td class="text-center"><a href="<?=printUrl('CarBudget','adminList', array('storeId'=>$v['storeId']))?>" target="_blank"><?=isset($allStoreList[$v['storeId']]) ? $allStoreList[$v['storeId']]['storeName'] : ''?></a></td>
      <td class="text-center"><?=(float)$v['budgetApplyGx']?></td>
      <td class="text-center"><?=(float)$v['budgetApplyRent']?></td>
      <td class="text-center"><?=(float)$v['budgetApplyMatching']?></td>
      <td class="text-center"><?=(float)$v['budgetApply']?></td>
      <td class="text-center"><?=(float)$v['subsidyGx']?></td>
      <td class="text-center"><?=(float)$v['settleApplyGx']?></td>
      <td class="text-center"><?=(float)$v['canSettleGx']?></td>
      <td class="text-center"><?=(float)$v['settleStoreTotal']?></td>
      <td class="text-center"><?=(float)$v['settleQiTotal']?></td>
      <td class="text-center"><?=(float)$v['settleRmpSupport']?></td>
      <td class="text-center"><?=(float)$v['subsidyMatching']?></td>
      <td class="text-center"><?=(float)$v['settleApplyMatching']?></td>
      <td class="text-center"><?=(float)$v['canSettleMatching']?></td>
      <td class="text-center"><?=(float)$v['settleMoney']?></td>
      <td class="text-center"><?=(float)$v['kpi']?></td>
      <td class="text-center"><?=(float)$v['finalSettleMoney']?></td>
    </tr>
    <?php } ?>
    <?php
    $total = getArrayColumnTotal($procList,
        array('budgetApplyGx','budgetApplyRent','budgetApplyMatching','budgetApply','subsidyGx','settleApplyGx','canSettleGx','settleStoreTotal','settleQiTotal','settleRmpSupport','subsidyMatching','settleApplyMatching','canSettleMatching','settleMoney','kpi','finalSettleMoney'),1);
    ?>
    <tr>
      <td class="text-center" colspan="6">合计</td>
      <td class="text-center"><?=$total['budgetApplyGx']?></td>
      <td class="text-center"><?=$total['budgetApplyRent']?></td>
      <td class="text-center"><?=$total['budgetApplyMatching']?></td>
      <td class="text-center"><?=$total['budgetApply']?></td>
      <td class="text-center"><?=$total['subsidyGx']?></td>
      <td class="text-center"><?=$total['settleApplyGx']?></td>
      <td class="text-center"><?=$total['canSettleGx']?></td>
      <td class="text-center"><?=$total['settleStoreTotal']?></td>
      <td class="text-center"><?=$total['settleQiTotal']?></td>
      <td class="text-center"><?=$total['settleRmpSupport']?></td>
      <td class="text-center"><?=$total['subsidyMatching']?></td>
      <td class="text-center"><?=$total['settleApplyMatching']?></td>
      <td class="text-center"><?=$total['canSettleMatching']?></td>
      <td class="text-center"><?=$total['settleMoney']?></td>
      <td class="text-center">
      <?php
      $count = count($procList);
      echo $count ? round((float)$total['kpi']/$count,2) : 0;
      ?>
      </td>
      <td class="text-center"><?=$total['finalSettleMoney']?></td>
    </tr>
  </tbody>
</table>
</div>
</form>